<?php
include('include/bootstrap.inc.php');


		
		//loop through urls

		$crawl_menu = mysql_query("SELECT * FROM urls");

		while ( $url = mysql_fetch_array($crawl_menu) or die(mysql_error())){
			
			//get the current page hash
			$currentpagehash = hash_page($url['url'],$url['strip_comments'],$url['strip_images']);

			//get the last hash
			$lastknownhash = last_known_hash($url['url']);

			//time to compare-------------------------------------------------------------
			if(compare_verbose($currentpagehash,$lastknownhash) == true){
				
			//nothing changed, so just record new hash

						record_hash( $url['url_id'], $hash_algo, $currentpagehash);

			}

			else{
			//something changed.  get the last hash's id, then record a new value, get that id, and store all that info in the changelog

				$prechange_hash_record = last_known_hash($url['url'],1);

				$new_record_id = record_hash( $url['url_id'], $hash_algo, $currentpagehash,1);

				add_log_entry( $prechange_hash_record, $new_record_id, $url['url_id'], "changed" );
										



				
			}  //end else








		} // end while



?>

